12 |
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[61991],{88362:function(n,e,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/learning-plans/[slug]/lessons/[lessonSlugOrId]",function(){return s(17648)}])},98038:function(n,e,s){"use strict";s.d(e,{Z:function(){return u}});var o=s(57044),t=s(57611),r=s(67597),l=s(15129),a=s(84020),i=function(){var n=(0,l.useRouter)();return(0,r.useEffect)((function(){var e=n.asPath;n.replace((0,a.gk)(e))}),[n]),(0,t.jsx)(t.Fragment,{})},c=s(19226),u=function(n){return function(e){var s=(0,r.useState)(!1),l=s[0],a=s[1];return(0,r.useEffect)((function(){a(!0)}),[]),l?(0,c.jl)()?(0,t.jsx)(n,(0,o.Z)({},e)):(0,t.jsx)(i,{}):null}}},17648:function(n,e,s){"use strict";s.r(e),s.d(e,{default:function(){return en}});var o,t=s(57611),r=s(15129),l=s(67385),a=s(61395),i=s(38745),c=s.n(i),u=s(98038),d=s(67597),_=s(1931),f=s(55699),h=s.n(f),x=s(85494),g=s(85609),m=s(12195),C=function(n){var e=n.isLoading,s=n.id,o=n.markLessonAsCompleted,r=(0,a.Z)("learn").t,l=(0,g.useToast)();return(0,t.jsx)(x.ZP,{isLoading:e,isDisabled:e,size:x.qE.Small,onClick:function(){(0,m.MY)("mark_lesson_as_completed",{lessonId:s}),o(s,(function(){l(r("mark-complete-success"),{status:g.ToastStatus.Success})}))},children:r("mark-complete")})},j=s(31855),p=s(10191),v=s(4083),S=s(32607),Z=s(58465),k=s(89932),L=s(4845),N=s(22570),E=s(9740),b=s(84020),I=function(n){var e=n.lesson,s=n.courseSlug,o=(0,Z.Z)(),l=e.day,i=e.id,c=e.isFirst,u=e.isLast,_=e.course,f=e.isCompleted,I=(0,r.useRouter)(),M=(0,a.Z)("learn").t,O=(0,S.Z)(),y=(0,v.Z)(),B=(0,d.useState)(!1),w=B[0],P=B[1],F=(0,g.useToast)(),T=(0,d.useState)(!1),Y=T[0],q=T[1],z=function(n,e){I.push((0,b.dC)(n,e))},R=!1===(null===_||void 0===_?void 0:_.userHasFeedback)&&(!0===(null===_||void 0===_?void 0:_.isCompleted)||!0===Y);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:h().buttonsContainer,children:[!c&&(0,t.jsx)(x.ZP,{isLoading:w,isDisabled:w,size:x.qE.Small,onClick:function(){(0,m.MY)("previous_lesson",{lessonId:i,isCompleted:f});var n=l-1,e=_.lessons[n-1].slug;o(),z(_.slug,e)},children:(0,t.jsx)(k.Z,{})}),!f&&(0,t.jsx)(C,{id:i,isLoading:w,markLessonAsCompleted:function(n,e){P(!0),(0,E.i1)({type:N.t.LESSON,lessonId:n}).then((function(){(0,p.z1)(y,s,n),(0,p.gx)(O,s,n),e&&e(),_.lessons.filter((function(n){return n.isCompleted})).length===_.lessons.length&&q(!0)})).catch((function(){F(M("common:error.general"),{status:g.ToastStatus.Error})})).finally((function(){P(!1)}))}}),!u&&(0,t.jsx)(x.ZP,{isLoading:w,isDisabled:w,size:x.qE.Small,onClick:function(){(0,m.MY)("next_lesson",{lessonId:i,isCompleted:f});var n=l-1,e=_.lessons[n+1].slug;o(),z(_.slug,e)},children:(0,t.jsx)(L.Z,{})})]}),(0,t.jsxs)("div",{className:h().addReflectionButton,children:[(0,t.jsx)(x.ZP,{size:x.qE.Small,onClick:function(){(0,m.MY)("add_lesson_reflection",{lessonId:i,isCompleted:f})},href:"https://quranreflect.com",isNewTab:!0,type:x.L$.Success,children:M("add-reflection")}),R&&(0,t.jsx)(j.Z,{shouldOpenModal:Y,course:_,source:j.E.LessonPage})]})]})},M=s(45361),O=s(37014),y=s.n(O),B=s(68249),w=s.n(B),P=s(99574),F=s(43609),T=function(n){var e=n.lessons,s=n.currentLessonId,o=n.courseSlug,l=n.isModal,i=void 0!==l&&l,c=(0,a.Z)("learn"),u=c.t,d=c.lang,_=(0,r.useRouter)();return(0,t.jsxs)("div",{className:y()(w().container,(0,M.Z)({},w().modalContainer,i)),children:[!i&&(0,t.jsx)("p",{className:w().heading,children:u("learning-plan-material")}),e.map((function(n,e){var r=e+1,l=n.title,a=n.isCompleted,i=n.id,c=n.slug,u=function(){!function(n,e){(0,m.MY)("sidebar_syllabus_lesson",{lessonId:n,courseSlug:o}),_.push((0,b.dC)(o,e))}(i,c)};return(0,t.jsx)("div",{role:"button",tabIndex:e,onClick:u,onKeyDown:u,className:y()(w().lessonContainer,(0,M.Z)({},w().currentLesson,i===s)),children:(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:w().day,children:"".concat((0,F.rQ)(r,d),": ")}),(0,t.jsxs)("span",{children:[l,a?(0,t.jsx)(P.Z,{}):""]})]})},i)}))]})},Y=s(31506),q=s.n(Y),z=s(10440),R=s(3222),H=s(55673),K=s(59807),A=s(21899),D=function(n){var e=n.lesson,s=n.courseSlug,o=n.lessonSlugOrId,r=e.title,l=e.content,i=e.day,c=(0,a.Z)("learn"),u=c.t,f=c.lang,h=(0,d.useState)(!1),g=h[0],C=h[1];return(0,t.jsx)(z.Z,{children:(0,t.jsxs)("div",{className:q().viewContainer,children:[(0,t.jsx)(K.default,{isOpen:g,onClose:function(){C(!1)},hasCloseButton:!0,header:(0,t.jsx)("p",{className:q().modalHeading,children:u("learning-plan-material")}),children:(0,t.jsx)(T,{isModal:!0,courseSlug:s,currentLessonId:e.id,lessons:e.course.lessons})}),(0,t.jsx)(T,{courseSlug:s,currentLessonId:e.id,lessons:e.course.lessons}),(0,t.jsx)("div",{className:q().container,children:(0,t.jsxs)(H.Z,{children:[(0,t.jsxs)("div",{className:q().headerButtonsContainer,children:[(0,t.jsxs)(x.ZP,{onClick:function(){(0,m.MY)("back_to_course",{lessonSlugOrId:o,courseSlug:s})},href:(0,b.ES)(s),variant:x.Wu.Ghost,children:[(0,t.jsx)(A.Z,{}),(0,t.jsx)("p",{className:q().backText,children:u("back-to-learning-plan")})]}),(0,t.jsx)(x.ZP,{onClick:function(){(0,m.MY)("course_material",{lessonSlugOrId:o,courseSlug:s}),C(!0)},variant:x.Wu.Ghost,className:q().courseMaterialButton,children:u("learning-plan-material")})]}),(0,t.jsx)("div",{className:q().headerContainer,children:(0,t.jsxs)("p",{className:q().title,children:["".concat(u("day")," ").concat((0,F.rQ)(i,f)),": ".concat(r)]})}),(0,t.jsx)("div",{className:q().contentContainer,children:(0,t.jsx)(_.iz,{children:(0,t.jsx)(R.Z,{isEditable:!1,defaultValue:l})})}),(0,t.jsx)(I,{lesson:e,courseSlug:s})]})})]})})},X=s(73756),G=s(21648),Q=s(57830),U=s(10117),W=s(86719),V=s.n(W);!function(n){n.CourseNotEnrolled="You are not enrolled in this course"}(o||(o={}));var $=o,J=s(37572),nn=function(){return(0,t.jsx)("div",{className:V().loadingContainer,children:(0,t.jsx)(U.Z,{})})},en=(0,u.Z)((function(){var n=(0,a.Z)("learn").lang,e=(0,r.useRouter)().query,s=e.slug,o=e.lessonSlugOrId,i=function(){(0,m.MY)("unenrolled_course_link",{courseSlugOrId:s,lessonSlugOrId:o})};return(0,t.jsx)("div",{className:V().pageContainer,children:(0,t.jsx)(X.Z,{loading:nn,queryKey:(0,J.Gk)(s,o),fetcher:E.UK,renderError:function(n){if((null===n||void 0===n?void 0:n.message)===$.CourseNotEnrolled)return(0,t.jsx)("div",{className:c().container,children:(0,t.jsx)(H.Z,{children:(0,t.jsx)(l.Z,{i18nKey:"learn:not-enrolled",components:{link:(0,t.jsx)(Q.Z,{onClick:i,href:(0,b.ES)(s),variant:Q.r.Blend},0)}})})})},render:function(e){return e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(G.Z,{title:e.title,url:(0,b.Z2)(n,(0,b.dC)(s,o))}),(0,t.jsx)(D,{lesson:e,lessonSlugOrId:o,courseSlug:s})]}):(0,t.jsx)(t.Fragment,{})}})})}))},55699:function(n){n.exports={buttonsContainer:"ActionButtons_buttonsContainer__8sYFk",addReflectionButton:"ActionButtons_addReflectionButton__a87_E"}},68249:function(n){n.exports={container:"CourseMaterial_container__woIAL",modalContainer:"CourseMaterial_modalContainer__XHCOl",heading:"CourseMaterial_heading__m2XoE",currentLesson:"CourseMaterial_currentLesson__jCz_g",lessonContainer:"CourseMaterial_lessonContainer__bHHIg",day:"CourseMaterial_day__FMLIb"}},31506:function(n){n.exports={viewContainer:"Lesson_viewContainer__KU3Kw",modalHeading:"Lesson_modalHeading__MRE72",container:"Lesson_container__pKSFk",backText:"Lesson_backText__BqDit",headerContainer:"Lesson_headerContainer__ccO73",title:"Lesson_title__7kl3n",tickIcon:"Lesson_tickIcon__ML0oE",contentContainer:"Lesson_contentContainer__P16lZ",headerButtonsContainer:"Lesson_headerButtonsContainer__ASxer",courseMaterialButton:"Lesson_courseMaterialButton__jS61z"}},38745:function(n){n.exports={container:"lessons_container__O0LbF"}}},function(n){n.O(0,[46911,15240,41167,47995,22042,49774,92888,40179],(function(){return e=88362,n(n.s=e);var e}));var e=n.O();_N_E=e}]);
- //# sourceMappingURL=[lessonSlugOrId]-35f0b0292c1819e3.js.map
|